# 作者: 赵炳森
# 2025年10月29日13时36分58秒
# 2215031808@qq.com
class Animal:
    def __init__(self, name):
        self.name = name
    def eat(self):
        print(f"{self.name}吃---")
    def drink(self):
        print("喝---")
    def run(self):
        print("跑---")
    def sleep(self):
        print("睡---")
# 继承父类写法是把父类放在括号里
class Dog(Animal):
    def __init__(self, name,color):
        super().__init__(name)
        self.color=color
    def bark(self):
        print(f"{self.name}汪汪叫{self.color}")
    def run(self):
        super().run()
        print(f'{self.name}跑得快')
class XiaoTianQuan(Dog):
    def __init__(self, name,color,age):
        super().__init__(name,color)
        self.age=age
    def fly(self):
        print(f"{self.name}飞天--{self.color}--{self.age}")

if __name__ == '__main__':
    wangcai=Dog("旺财",'黄色')
    wangcai.bark()
    wangcai.run()
    xiaotianquan=XiaoTianQuan('哮天犬','黑色','19')
    xiaotianquan.fly()
    xiaotianquan.eat()
